#pragma once

typedef void (*funResultCallBack) (DWORD userdata1,DWORD userdata2, const char* pszKey, BSTR  newResult);
struct CallbackNode
{
	funResultCallBack pCallBack;
	DWORD userData1;
	DWORD userData2;
	const void* luaFunction;
};

class Event
{
public:
	Event(void);
	~Event(void);

public:
	void	Fire_LuaEvent(const char* pszKey, const char* bstrParams);
	void	Fire_LuaEvent(const char* pszKey, BSTR bstrParams);
	int		AttachListener(DWORD userData1,DWORD userData2,funResultCallBack pfn, const void* pfun);
	int		DetachListener(DWORD userData1, const void* pfun);

private:
	std::vector<CallbackNode> m_allCallBack;

};
